# 方法1
#import numpy
#import time
#print('猜一猜会返回什么数字（1~10）')
#time.sleep(1)
#print(numpy.random.randint(1, 10, 1))
#print('你猜对了吗？')

# 方法2
print()
import random

target = random.randint(1, 30)
times = 0
print("开始,你有五次机会(1~30)")
while times <= 5:
    num = int(input('输入：'))
    times += 1
    if num > target:
        print("大了，请继续猜")
        continue
    elif num < target:
        print("小了，继续猜")
        continue
    else:
        print(f"对了，你运气真好，答案是{target}")
        break

if times == 6:
    print(f"很遗憾，你猜错了，正确答案是{target}")
